home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / blkpanel.cpp < prev    next >
C/C++ Source or Header  |  1994-10-10  |  3KB  |  88 lines

  1. #include "blkpanel.h"
  2.  
  3. BlockPanel::BlockPanel(rect coord, char* fName, char* h,
  4.            char* HOT,
  5.            int ITEMTYPE, int* ITEMLIST, loc ITEMDISTANCE,
  6.            rect STATUSPOS,
  7.            int STATUSTYPE, char** STATUSSTRINGS,
  8.            int* STATUSLIST, int res, int s,
  9.            BORDERS b_type, BORDERS hdr_b_type, int pat, int hdr_pat,
  10.            int elem_pat, int menu_pat)
  11.         : Block(coord, fName, "", s,
  12.            res, b_type, NO_BORDER, pat, hdr_pat, elem_pat)
  13.     {
  14.     menu = new IconMenu(rect(coord.origin.X + 3 + textX(s),
  15.              coord.origin.Y + textY(s) + 1,
  16.          coord.corner.X - 3 - textX(s),
  17.          coord.corner.Y - 1 - textY(s)),
  18.          "", h, HOT, 1, 1,
  19.            ITEMTYPE, ITEMLIST, ITEMDISTANCE,
  20.            STATUSPOS, STATUSTYPE, STATUSSTRINGS,
  21.            STATUSLIST, FIXED, 0, b_type, hdr_b_type, menu_pat,
  22.            hdr_pat);
  23.  
  24.     menu->set_ret(1);
  25.  
  26.     insert(menu, 1);
  27.  
  28.     assign(menu, up_element, AC_UP);
  29.     assign(menu, dn_element, AC_DOWN);
  30.     assign(menu, cancel_element, AC_CANCEL);
  31.     assign(menu, pg_up_element, AC_PG_UP);
  32.     assign(menu, pg_dn_element, AC_PG_DN);
  33.     assign(menu, left_element, AC_LEFT);
  34.     assign(menu, right_element, AC_RIGHT);
  35.     }
  36. ////////////////////////
  37. void BlockPanel::rearrange()
  38.     {
  39.     Block::rearrange();
  40.     rect coord = textRect(w1->bound());
  41.  
  42.     int sx = textX(w1->get_shadow());
  43.     int sy = textY(w1->get_shadow());
  44.  
  45.     menu->repose(rect(coord.origin.X + 3 + sx, coord.origin.Y + 1 + sy,
  46.               coord.corner.X - 3 - sx,
  47.               coord.corner.Y - 1 - sy));
  48.     }
  49. ////////////////////
  50. void BlockPanel::hide()
  51.     {
  52.     menu->hide();
  53.     w1->hide();
  54.     }
  55. ///////////////////////////
  56. /*
  57. #include "hypview.h"
  58. #include "help.h"
  59. void main()
  60.     {
  61.     if(!init_KNOW_HOW())
  62.         return;
  63.     setfillstyle(SOLID_FILL, pColorSet->colors.BAK_COLOR);
  64.     bar(0, 0, getmaxx(), getmaxy());
  65.  
  66.     int LIST[] = { 1, 2, 3, 1, 2, 3, 3, 2, 1, 2, 0 };
  67.     BlockPanel b(rect(10, 10, 60, 16), "window.pcy", "Icon Menu",
  68.            "1234567890", SMALL_ICON, LIST, loc(5, 5),
  69.            rect(0, 20, 79, 25), LARGE_ICON,
  70.            NULL, LIST,
  71.            MOVE | RESIZE | SCROLL_VERT | SCROLL_HORIZ, 6,
  72.            SHOW_BORDER, SHOW_BORDER, 11, 12, 13, 16);
  73.  
  74.     rect r_help(5, 5, 70, 25);
  75.     help_object = new HypertextView(r_help, "help.hyp",
  76.         "_help.pcy", MOVE | RESIZE | SCROLL_VERT | SCROLL_HORIZ,
  77.     pScreenSet->sub_interval, SHOW_BORDER,
  78.     25, "HELP", BLUE, YELLOW, 56);
  79.     b.set_help_context("common  ");
  80.     b.show_window();
  81.     b.exe();
  82.     b.hide();
  83.  
  84.     delete help_object;
  85.     close_KNOW_HOW();
  86.     closegraph();
  87.     }
  88. */